<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view>
        <ui:page binding="#{CreaDisenoBalance.page1}" id="page1">
            <ui:html binding="#{CreaDisenoBalance.html1}" id="html1">
                <ui:head binding="#{CreaDisenoBalance.head1}" id="head1">
                    <ui:link binding="#{CreaDisenoBalance.link1}" id="link1" url="/resources/stylesheet.css"/>
                </ui:head>
                <ui:body binding="#{CreaDisenoBalance.body1}" id="body1" style="-rave-layout: grid">
                    <ui:form binding="#{CreaDisenoBalance.form1}" id="form1" virtualFormsConfig="">
                        <div style="position: absolute; left: 0px; top: 0px">
                            <jsp:directive.include file="encab1.jspf"/>
                        </div>
                        <ui:button action="#{CreaDisenoBalance.button1_action}" binding="#{CreaDisenoBalance.button1}" id="button1" immediate="true" mini="true"
                            primary="true" style="left: 48px; top: 144px; position: absolute; width: 71px" text="Cerrar"/>
                        <ui:table binding="#{CreaDisenoBalance.table1}" id="table1" style="left: 639px; top: 217px; position: absolute"
                            title="Variables en Diseño" width="512">
                            <script><![CDATA[                           
       /* ----- Functions for Table Preferences Panel ----- */
       /*
       * Toggle the table preferences panel open or closed
       */
       function togglePreferencesPanel() {
       var table = document.getElementById("form1:table1");
       table.toggleTblePreferencesPanel();
       }
       /* ----- Functions for Filter Panel ----- */
       /*
       * Return true if the filter menu has actually changed,
       * so the corresponding event should be allowed to continue.
       */
       function filterMenuChanged() {
       var table = document.getElementById("form1:table1");
       return table.filterMenuChanged();
       }
       /*
       * Toggle the custom filter panel (if any) open or closed.
       */
       function toggleFilterPanel() {
       var table = document.getElementById("form1:table1");
       return table.toggleTableFilterPanel();
       }
       /* ----- Functions for Table Actions ----- */
       /*
       * Initialize all rows of the table when the state
       * of selected rows changes.
       */
       function initAllRows() {
       var table = document.getElementById("form1:table1");
       table.initAllRows();
       }
       /*
       * Set the selected state for the given row groups
       * displayed in the table.  This functionality requires
       * the 'selectId' of the tableColumn to be set.
       *
       * @param rowGroupId HTML element id of the tableRowGroup component
       * @param selected Flag indicating whether components should be selected
       */
       function selectGroupRows(rowGroupId, selected) {
       var table = document.getElementById("form1:table1");
       table.selectGroupRows(rowGroupId, selected);
       }
       /*
       * Disable all table actions if no rows have been selected.
       */
       function disableActions() {
       // Determine whether any rows are currently selected
       var table = document.getElementById("form1:table1");
       var disabled = (table.getAllSelectedRowsCount() > 0) ? false : true;
       // Set disabled state for top actions
       document.getElementById("form1:table1:tableActionsTop:deleteTop").setDisabled(disabled);
       // Set disabled state for bottom actions
       document.getElementById("form1:table1:tableActionsBottom:deleteBottom").setDisabled(disabled);
       }

       public String getNameStyleClass() {
       String name = (String) getValue("#{currentRow.value['tipoCampo']}");
       if ((tipoCampo != null) && (tipoCampo.startsWith("T")){
       return "nameStyleClass";
       }else{
       return "noStyleClass";
       }
       } ]]></script>
                            <ui:tableRowGroup binding="#{CreaDisenoBalance.tableRowGroup1}" id="tableRowGroup1" rows="10" sourceData="#{SessionBean1.variables}" sourceVar="currentRow">
                                <ui:tableColumn binding="#{CreaDisenoBalance.tableColumn3}" headerText="Codigo" id="tableColumn3" sort="variable"
                                    style="#{CreaDisenoBalance.cstyle}" width="40">
                                    <ui:staticText binding="#{CreaDisenoBalance.staticText3}" id="staticText3" text="#{currentRow.value['variable']}"/>
                                </ui:tableColumn>
                                <ui:tableColumn binding="#{CreaDisenoBalance.tableColumn17}" headerText="Descripcion" id="tableColumn17" sort="descripcion"
                                    style="#{CreaDisenoBalance.cstyle}" width="100">
                                    <ui:staticText binding="#{CreaDisenoBalance.staticText12}" id="staticText12" text="#{currentRow.value['descripcion']}"/>
                                </ui:tableColumn>
                                <ui:tableColumn binding="#{CreaDisenoBalance.tableColumn2}" headerText="Area" id="tableColumn2" sort="type"
                                    style="#{CreaDisenoBalance.cstyle}" width="40">
                                    <ui:staticText binding="#{CreaDisenoBalance.staticText2}" id="staticText2" text="#{currentRow.value['type']}"/>
                                </ui:tableColumn>
                                <ui:tableColumn binding="#{CreaDisenoBalance.tableColumn1}" headerText="Posicion" id="tableColumn1" sort="posicion"
                                    style="#{CreaDisenoBalance.cstyle}" width="20">
                                    <ui:staticText binding="#{CreaDisenoBalance.staticText1}" id="staticText1" text="#{currentRow.value['posicion']}"/>
                                </ui:tableColumn>
                                <ui:tableColumn align="center" binding="#{CreaDisenoBalance.tableColumn4}" id="tableColumn4" style="#{CreaDisenoBalance.cstyle}">
                                    <ui:button action="#{CreaDisenoBalance.button3_action}" binding="#{CreaDisenoBalance.button3}" id="button3" mini="true"
                                        onClick="if(!confirm('¿Seguro que desea quitar  esta Variable?')){return false;}" primary="true" text="Quitar"/>
                                </ui:tableColumn>
                                <ui:tableColumn align="center" binding="#{CreaDisenoBalance.tableColumn5}" id="tableColumn5" style="#{CreaDisenoBalance.cstyle}">
                                    <ui:button action="#{CreaDisenoBalance.buttonUp_action}" binding="#{CreaDisenoBalance.buttonUp}" id="buttonUp"
                                        imageURL="/resources/FlechaArriba.jpg" mini="true" primary="true" text="Subir"/>
                                </ui:tableColumn>
                                <ui:tableColumn align="center" binding="#{CreaDisenoBalance.tableColumn6}" id="tableColumn6" style="#{CreaDisenoBalance.cstyle}">
                                    <ui:button action="#{CreaDisenoBalance.buttonDown_action}" binding="#{CreaDisenoBalance.buttonDown}" id="buttonDown"
                                        imageURL="/resources/FlechaAbajo.jpg" mini="true" primary="true" text="Bajar"/>
                                </ui:tableColumn>
                            </ui:tableRowGroup>
                            <f:facet name="actionsTop">
                                <ui:button action="#{CreaDisenoBalance.btnGuardar_action}" binding="#{CreaDisenoBalance.btnGuardar}" id="btnGuardar" mini="true"
                                    primary="true" style="left: 600px; top: 144px" text="Guardar Todo"/>
                            </f:facet>
                            <f:facet name="actionsBottom">
                                <ui:button action="#{CreaDisenoBalance.btnCancelar_action}" binding="#{CreaDisenoBalance.btnCancelar}" disabled="true"
                                    id="btnCancelar" mini="true"
                                    onClick="if(!confirm('¿Seguro que desea ocultar las variables?\n se descartarán todos los cambios.')){return false;}"
                                    style="left: 576px; top: 120px" text="Ocultar Todo" visible="false"/>
                            </f:facet>
                        </ui:table>
                        <ui:table binding="#{CreaDisenoBalance.table2}" deselectMultipleButton="true" id="table2" selectMultipleButton="true"
                            style="left: 44px; top: 217px; position: absolute; width: 589px" title="Variables" width="591">
                            <script><![CDATA[
       /* ----- Functions for Table Preferences Panel ----- */
       /*
       * Toggle the table preferences panel open or closed
       */
       function togglePreferencesPanel() {
       var table = document.getElementById("form1:table2");
       table.toggleTblePreferencesPanel();
       }
       /* ----- Functions for Filter Panel ----- */
       /*
       * Return true if the filter menu has actually changed,
       * so the corresponding event should be allowed to continue.
       */
       function filterMenuChanged() {
       var table = document.getElementById("form1:table2");
       return table.filterMenuChanged();
       }
       /*
       * Toggle the custom filter panel (if any) open or closed.
       */
       function toggleFilterPanel() {
       var table = document.getElementById("form1:table2");
       return table.toggleTableFilterPanel();
       }
       /* ----- Functions for Table Actions ----- */
       /*
       * Initialize all rows of the table when the state
       * of selected rows changes.
       */
       function initAllRows1() {
       var table = document.getElementById("form1:table2");
       table.initAllRows();
       }
       /*
       * Set the selected state for the given row groups
       * displayed in the table.  This functionality requires
       * the 'selectId' of the tableColumn to be set.
       *
       * @param rowGroupId HTML element id of the tableRowGroup component
       * @param selected Flag indicating whether components should be selected
       */
       function selectGroupRows(rowGroupId, selected) {
       var table = document.getElementById("form1:table2");
       table.selectGroupRows(rowGroupId, selected);
       }
       /*
       * Disable all table actions if no rows have been selected.
       */
       function disableActions() {
       // Determine whether any rows are currently selected
       var table = document.getElementById("form1:table2");
       var disabled = (table.getAllSelectedRowsCount() > 0) ? false : true;
       // Set disabled state for top actions
       document.getElementById("form1:table2:tableActionsTop:deleteTop").setDisabled(disabled);
       // Set disabled state for bottom actions
       document.getElementById("form1:table2:tableActionsBottom:deleteBottom").setDisabled(disabled);
       }]]></script>
                            <ui:tableRowGroup binding="#{CreaDisenoBalance.tableRowGroup2}" emptyDataMsg="Sin Registros" id="tableRowGroup2" rows="10"
                                selected="#{CreaDisenoBalance.selectedState}" sourceData="#{CreaDisenoBalance.sct0075DataProvider}" sourceVar="currentRow">
                                <ui:tableColumn align="center" binding="#{CreaDisenoBalance.tableColumn12}" id="tableColumn12"
                                    onClick="setTimeout('initAllRows1()',0)" selectId="checkbox1" valign="middle" width="31">
                                    <ui:checkbox binding="#{CreaDisenoBalance.checkbox1}" id="checkbox1" selected="#{CreaDisenoBalance.selected}" selectedValue="#{CreaDisenoBalance.selectedValue}"/>
                                </ui:tableColumn>
                                <ui:tableColumn binding="#{CreaDisenoBalance.tableColumn7}" headerText="Codigo" id="tableColumn7" sort="SCT0075.CDGOVRBLE" width="103">
                                    <ui:staticText binding="#{CreaDisenoBalance.staticText4}" id="staticText4" text="#{currentRow.value['SCT0075.CDGOVRBLE']}"/>
                                </ui:tableColumn>
                                <ui:tableColumn binding="#{CreaDisenoBalance.tableColumn8}" headerText="Descripcion" id="tableColumn8" sort="SCT0075.DSCRPCION" width="151">
                                    <ui:staticText binding="#{CreaDisenoBalance.staticText5}" id="staticText5" text="#{currentRow.value['SCT0075.DSCRPCION']}"/>
                                </ui:tableColumn>
                                <ui:tableColumn binding="#{CreaDisenoBalance.tableColumn9}" headerText="Usada para:" id="tableColumn9" width="103">
                                    <ui:staticText binding="#{CreaDisenoBalance.staticText6}" id="staticText6" text="#{CreaDisenoBalance.tipoVar}"/>
                                </ui:tableColumn>
                                <ui:tableColumn binding="#{CreaDisenoBalance.tableColumn10}" headerText="Campo de Porcentaje" id="tableColumn10"
                                    sort="VRBLEPRCNTJE" width="190">
                                    <ui:staticText binding="#{CreaDisenoBalance.staticText7}" id="staticText7" text="#{currentRow.value['VRBLEPRCNTJE']}"/>
                                </ui:tableColumn>
                            </ui:tableRowGroup>
                            <f:facet name="title">
                                <ui:panelGroup binding="#{CreaDisenoBalance.groupPanel1}" id="groupPanel1" style="left: 24px; top: 168px">
                                    <ui:panelLayout binding="#{CreaDisenoBalance.layoutPanel2}" id="layoutPanel2" panelLayout="flow">
                                        <ui:label binding="#{CreaDisenoBalance.label3}" id="label3" text="Variables disponibles"/>
                                    </ui:panelLayout>
                                    <ui:panelLayout binding="#{CreaDisenoBalance.layoutPanel1}" id="layoutPanel1" panelLayout="flow">
                                        <ui:textField binding="#{CreaDisenoBalance.textField1}" columns="40" id="textField1" maxLength="20" toolTip="Maximo 20 caracteres."/>
                                        <ui:button action="#{CreaDisenoBalance.button4_action}" binding="#{CreaDisenoBalance.button4}" id="button4" mini="true"
                                            primary="true" text="Insertar Titulo"/>
                                    </ui:panelLayout>
                                </ui:panelGroup>
                            </f:facet>
                            <f:facet name="actionsTop">
                                <ui:button action="#{CreaDisenoBalance.button2_action}" binding="#{CreaDisenoBalance.button2}" id="button2" mini="true"
                                    primary="true" style="width: 71px" text="Agregar &gt;"/>
                            </f:facet>
                        </ui:table>
                        <h:panelGrid binding="#{CreaDisenoBalance.gridPanel1}" columns="4" id="gridPanel1" style="left: 41px; top: 185px; position: absolute" width="474">
                            <ui:label binding="#{CreaDisenoBalance.label1}" id="label1" text="Diseño:"/>
                            <ui:staticText binding="#{CreaDisenoBalance.staticText8}" id="staticText8" text="#{SessionBean1.codigoDiseno}"/>
                            <ui:label binding="#{CreaDisenoBalance.label2}" id="label2" text="Sub Área:"/>
                            <ui:dropDown binding="#{CreaDisenoBalance.dropDownSubArea}" id="dropDownSubArea"
                                items="#{CreaDisenoBalance.dropDownSubAreaDefaultOptions.options}"
                                onChange="common_timeoutSubmitForm(this.form, 'gridPanel1:dropDownSubArea');"
                                selected="#{CreaDisenoBalance.dropDownSubAreaDefaultOptions.selectedValue}" valueChangeListener="#{CreaDisenoBalance.dropDownSubArea_processValueChange}"/>
                        </h:panelGrid>
                        <ui:staticText binding="#{CreaDisenoBalance.stxtSwicth}" id="stxtSwicth" style="position: absolute; left: 480px; top: 120px" visible="false"/>
                        <ui:alert binding="#{CreaDisenoBalance.alert1}" id="alert1" style="left: 320px; top: 110px; position: absolute"/>
                        <ui:hiddenField binding="#{CreaDisenoBalance.hiddenField1}" id="hiddenField1"/>
                        <ui:staticText binding="#{CreaDisenoBalance.stxtInfo}" id="stxtInfo" style="left: 48px; top: 120px; position: absolute" visible="false"/>
                        <ui:button action="#{CreaDisenoBalance.button5_action}" binding="#{CreaDisenoBalance.button5}" disabled="true" id="button5" mini="true"
                            primary="true" style="left: 624px; top: 168px; position: absolute; width: 156px" text="Cargar variables del diseño" visible="false"/>
                        <ui:button action="#{CreaDisenoBalance.btnRegresar_action}" binding="#{CreaDisenoBalance.btnRegresar}" id="btnRegresar" mini="true"
                            primary="true" style="left: 141px; top: 144px; position: absolute; width: 80px" text="Regresar"/>
                    </ui:form>
                </ui:body>
            </ui:html>
        </ui:page>
    </f:view>
</jsp:root>
